package tgc.edu.exam.entity;

import java.util.UUID;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import tgc.edu.exam.custom.BaseEntity;
@Entity
public class Evaluation extends BaseEntity<UUID>{
	private EvaluationRule evaluationRule;
	private UUID evaluationXzId;
	/** 类型 **/
	private String type;
	/** 说明 **/
	private String explain;
	/** 评价体系 **/
	private String system;
	/** 权重 **/
	private double weight;
	/** 成绩 **/
	private double grade;
	/** post提交的成绩 **/
	private double postgrade;
	
	private String postisno;
	/** 无实际意义 **/
	private Integer sum;
	
	
	public Integer getSum() {
		return sum;
	}
	public void setSum(Integer sum) {
		this.sum = sum;
	}
	public double getWeight() {
		return weight;
	}
	public void setWeight(double weight) {
		this.weight = weight;
	}
	@ManyToOne
	public EvaluationRule getEvaluationRule() {
		return evaluationRule;
	}
	public void setEvaluationRule(EvaluationRule evaluationRule) {
		this.evaluationRule = evaluationRule;
	}
	public UUID getEvaluationXzId() {
		return evaluationXzId;
	}
	public void setEvaluationXzId(UUID evaluationXzId) {
		this.evaluationXzId = evaluationXzId;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getExplain() {
		return explain;
	}
	public void setExplain(String explain) {
		this.explain = explain;
	}
	public String getSystem() {
		return system;
	}
	public void setSystem(String system) {
		this.system = system;
	}
	public double getGrade() {
		return grade;
	}
	public void setGrade(double grade) {
		this.grade = grade;
	}
	public double getPostgrade() {
		return postgrade;
	}
	public void setPostgrade(double postgrade) {
		this.postgrade = postgrade;
	}
	public String getPostisno() {
		return postisno;
	}
	public void setPostisno(String postisno) {
		this.postisno = postisno;
	}
	@Transient
	public String getGrades() {
		return getGrade() != 0.0 ? getGrade()+"星": "";
	}
	
	
}
